#pragma once

#include "ModelessDialog.h"

// SummaryDlg dialog

class SummaryDlg : public CModelessDialog, public L_Observer
{
	DECLARE_DYNAMIC(SummaryDlg)

public:
	SummaryDlg(CWnd* pParent = NULL);   // standard constructor
	virtual ~SummaryDlg();

	virtual BOOL Create(CWnd *pParentWnd = CWnd::FromHandle(L_GetMainWnd()));

// Dialog Data
	enum { IDD = IDD_SUMMARYDLG };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

protected:
// L_Observer
	virtual void HandleMessage(L_Message const *pMsg);

private:
	CListCtrl m_SummaryDataListCtrl;
	char APIFunctions[128][32];
	
	//helper functions
	void SetAPIFunctions();
	void InitializeDataCtrlRows();
	void UpdateStaticValues(); //static values that don't change (or don't change often)
	void UpdateL1Values(); //values that change on L1 updates
	void UpdateOIValues(); //values that change on imbalance updates
	void UpdateTFValues(); //values that change on TF (chart) updates
	void ClearValues();
	CString GetTextForFunction(int function);
	void ResizeControls();
	void SetSymbol(const char *symbol);

	//controls
	CEdit m_SymbolEdit;
	CComboBox m_TFCombo;

	//data
	L_Summary *summary;

	//options
	long m_TFValue;
	bool m_Linked;

private:
	afx_msg void OnTFChange();
	afx_msg void OnFileLink();
	virtual void OnOK();
	virtual BOOL OnInitDialog();
	afx_msg void OnSize(UINT nType, int cx, int cy);
};
